/*
 * @Description:
 * @Author: 稽辉
 * @Date: 2025-01-19 19:04:29
 * @LastEditTime: 2025-03-08 12:16:13
 * @LastEditors: 稽辉
 */
import type { Banners, Categories, Goods } from '@/api'
import type { GoodsItem, PageParams, PageResult } from '@/types/global'
import type { BannerItem, CategoryItem, GuessItem } from '@/types/home'

import { http } from '@/utils/http'
export const getHomeBannerAPI = (type = 1) => {
  return http<Banners[]>({
    method: 'GET',
    url: '/home/banner',
    data: {
      type,
    },
  })
}
export const getHomeCategoryAPI = () => {
  return http<Categories[]>({
    method: 'GET',
    url: '/home/categories/multi',
  })
}

/*
/home/goods/guessLike
*/
export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/goods/pages',
    data,
  })
}

export const getGoodsByKeyword = (keyword: string) => {
  return http<GoodsItem[]>({
    method: 'GET',
    url: '/goods/search',
    data: {
      keyword,
    },
  })
}
